import sys, time 
sys.path += [ "E:\\Python", "C:\\Python" ]
import dictflib, dictdlib

if not sys.platform.startswith("symbian"):
  DICT = "wn"
else:
  import e32
  if e32.in_emulator():
    DICT = r"C:\Data\Others\hil-eng-ger"
    DICT = r"C:\Data\Others\wn"
  else:
    DICT = r"E:\Dict\hil-eng-ger"
    DICT = r"E:\Dict\wn"

def main():
  s = time.clock()
  d = dictflib.DictDB(DICT)
  # d = dictdlib.DictDB(DICT)

  print "build index:", time.clock() - s

  for w in ["jejunity", "countersuit",  "Pomatomus", "zonula",
            "'hood", "Zyrian", "whateveryouwillneverfind", "mag-an"]:
    s = time.clock()
    dummy = d.getdef(w)
    print "search:", w, dummy != [], time.clock() - s

  if not sys.platform.startswith("symbian"):
    print "Press <ENTER>"
    sys.stdin.readline()

  del d

if __name__ in [ "__main__", "editor" ]:
  main()
